home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / me_cd25.zip / MUTT2.ZIP / FILTER.MUT < prev    next >
Lisp/Scheme  |  1992-11-09  |  832b  |  41 lines

  1.   ;; C Durland    Public Domain
  2.  
  3. (include me2.h)
  4.  
  5. (defun filter
  6. {
  7.   (bool input_from_reg)
  8.   (int bag-in bag-out)
  9.   (string filter-name)
  10.  
  11.   (filter-name
  12.     (ask (if (arg-flag) "Suck in output from filter: " "Filter region: ")))
  13.   (input_from_reg FALSE)(bag-in -1)
  14.  
  15.   (if (not (arg-flag))
  16.     {
  17.       (clear-bag CUT-BUFFER) (append-to-bag CUT-BUFFER APPEND-REGION)
  18.       (bag-in CUT-BUFFER) (input_from_reg TRUE)
  19.     })
  20.  
  21.   (bag-out (create-bag))
  22.   (if (OS-filter filter-name bag-in bag-out)
  23.     {
  24.       (if input_from_reg (delete-region))
  25.       (insert-bag bag-out)
  26.     })
  27.  
  28.   (free-bag bag-out)
  29. })
  30.  
  31. (defun 
  32.   shove-region-to-process
  33.   {
  34.     (int bag-id)
  35.  
  36.     (append-to-bag (bag-id (create-bag)) APPEND-REGION)
  37.     (OS-filter (ask "Shove region to process: ") bag-id)
  38.     (free-bag bag-id)
  39.   }
  40. )
  41.